import imgaug.augmenters as iaa

from text_renderer.effect import *
from text_renderer.effect.curve import Curve


def get_effects():
    poses = [
        "top",
        "bottom",
        "left",
        "right",
        "top_left",
        "top_right",
        "bottom_left",
        "bottom_right",
        "horizontal_middle",
        "vertical_middle",
    ]

    effects = []

    effects.append(Line())
    for pos, item in enumerate(poses):
        pos_p = [0] * len(poses)
        pos_p[pos] = 1
        # effects.append(Line(p=1, thickness=(3, 4), line_pos_p=item))
        effects.append(Line(p=1, thickness=(3, 4), line_pos_p=pos_p))

    effects.append(DropoutRand())
    effects.append(DropoutRand(p=1, dropout_p=(0.3, 0.5)))

    effects.append(DropoutHorizontal())
    effects.append(DropoutHorizontal(p=1, num_line=2, thickness=3))

    effects.append(DropoutVertical())
    effects.append(DropoutVertical(p=1, num_line=15))

    effects.append(Padding())
    effects.append(Padding(p=1, w_ratio=[0.2, 0.21], h_ratio=[0.7, 0.71], center=True))

    effects.append(ImgAugEffect())
    effects.append(ImgAugEffect(aug=iaa.Emboss(alpha=(0.9, 1.0), strength=(1.5, 1.6))))

    effects.append(Curve())
    effects.append(Curve(p=1, period=180, amplitude=(4, 5)))

    effects.append(MotionBlur())
    return effects
